﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using AAA = Autodesk.AutoCAD.ApplicationServices;
using System.Reflection;
using System.IO;
using Autodesk.AutoCAD.DatabaseServices;
using System.Runtime.CompilerServices;
using Newtonsoft.Json.Linq;
using System.Threading;

namespace DonetArxLib.EmployeeSample
{
    public partial class EmployeeDetailCtrl : UserControl
    {
        public EmployeeDetailCtrl()
        {
            InitializeComponent();
        }

        private void Label5_MouseMove(object sender, MouseEventArgs e)
        {
            if (MouseButtons == MouseButtons.Left)
            {
                Autodesk.AutoCAD.ApplicationServices.Application.DoDragDrop(this, this, DragDropEffects.All, new MyDropTarget());
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            
            var doc= AAA.Application.DocumentManager.MdiActiveDocument;
            if (doc == null)
                return;

            Thread.Sleep(1000);

            using (var locker = doc.LockDocument())
            {
                UtilFunc.InsertImageOle("d:\\test\\img.png", 0, 0, 100, 100, 0);
            }
        }
    }
}
